/*
 * 	You need to complete the constructors, setSalary, 
 *     computeBiweeklyPaycheck, and print methods.
 */

/**
 * @author Andrew Shore
 * @author clint
 * 
 * SalariedEmployee represents an Employee who makes a fixed amount of money
 * every year.
 */
public class SalariedEmployee extends Employee {
	/**
	 * <i>salary</i> represents the amount of money the SalariedEmployee makes
	 * annually.
	 */
	private double salary;

	/**
	 * default constructor
	 */
	public SalariedEmployee() {
		super();
		salary=0;
	}

	public SalariedEmployee(String name, int age, String jobTitle, double newSalary) {
		super(name,age,jobTitle);
		salary=newSalary;
	}

	/**
	 * postcondition: the <i>salary</i> of this Employee has been returned.
	 */
	public double getSalary() {
		return salary;
	}

	/**
	 * precondition: the parameter <i>salary</i> is > 0.
	 * 
	 * postcondition: the <i>salary</i> of the SalariedEmployee has been set to
	 * the value of the parameter <i>salary</i> if and only if it is > than 0,
	 * otherwise no action.
	 */
	public void setSalary(double newSalary) {
		salary=newSalary;
	}

	/**
	 * postcondition: the amount of money the Employee makes every two weeks is
	 * returned.
	 */
	public double computeBiweeklyPaycheck() {
		double paycheck=salary/26;

		return paycheck;// to make compiler happy
	}

	/**
	 * postcondition: all of the information about this Salaried Employee will
	 * be printed to the console.
	 */
	public void print() {
		super.print();
		//hint: should you call the print method in
		//  the parent class
		System.out.println("Yearly salary is "+salary);
		System.out.println("Biweekly paycheck is "+computeBiweeklyPaycheck());
	}
}


